<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="module/head :: common_header(~{::title},~{::link},~{::script})">
    <title>创作文章</title>
    <link rel="stylesheet" href="/plugins/editor/lib/codemirror/codemirror.min.css"/>
    <link rel="stylesheet" href="/plugins/editor/css/editormd.css"/>
    <link rel="stylesheet" href="/css/editor.css"/>
    <script src="/plugins/editor/editormd.min.js"></script>
    <script src="/js/editor.js"></script>
</head>
<body>
<div class="header heard">
    <div class="am-g">
        <div class="am-u-md-10 am-u-sm-centered">
            <div class="am-g editor-header">
                <div class="am-u-lg-2">
                    <a class="" href="/">&lt;返回主页</a>
                </div>
                <div class="am-u-lg-6">
                    <div class="am-input-group">
                        <input th:value="${article!=null?article.getArticleTitle():''}" id="title" name="title" type="text" class="am-form-field" placeholder="请输入文章标题">
                    </div>
                </div>
                <div class="am-u-lg-2">
                    <a class="btn-save">保存草稿</a>
                </div>
                <div class="am-u-lg-2">
                    <a class="btn-release" id="commit-btn">发布文章</a>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="editormd">
    <textarea  th:text="${article!=null?article.getArticleContent():''}" style="display:none;"
               name="editormd-markdown-doc" id="content"></textarea>
    <!-- 第二个隐藏文本域，用来构造生成的HTML代码，方便表单POST提交-->
    <textarea th:text="${article!=null?article.getArticleHtmlContent():''}" class="editormd-html-textarea" name="text" id="htmlContent"></textarea>
</div>

<script type="text/javascript" src="/plugins/amazeUI/js/amazeui.js"></script>
<script type="text/javascript" src="/js/common.js"></script>

<div th:include="module/alert::alert"></div>
</body>
</html>